Component({
  properties: {
    titles:{
      type:Array,
      value:[]
    }
  },
  data: {
    currentIndex:0
  },
  methods: {
    handleItemClick(event){
      //1.取出index
      const index=event.currentTarget.dataset.index;
      //2.修改currentIndex
      this.setData({
        currentIndex:index
      })
      //3.通知页面点击的事件
      this.triggerEvent('itemclick',{index,title:this.properties.titles[index]},{})
    }
  }
})
